package com.hxzy.system.service.impl;

import com.hxzy.common.core.domain.entity.Role;
import com.hxzy.system.mapper.RoleMapper;
import com.hxzy.system.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Set;

/**
 * 类说明
 *
 * @author admin
 * @date 2021-09-25
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class RoleServiceImpl extends CommonServiceImpl<Role,Long> implements RoleService {
    private RoleMapper roleMapper;

    @Autowired
    public void setRoleMapper(RoleMapper roleMapper) {
        this.roleMapper = roleMapper;
        super.setMyBatisBaseDao(roleMapper);
    }

    @Override
    public Set<String> getRolePermission(Long userId) {
        return this.roleMapper.getRolePermission(userId);
    }

    @Override
    public List<Role> search(Role role) {
        return this.roleMapper.search(role);
    }
}
